package cn.com.headfree.base.controller;

import java.io.Serializable;

@SuppressWarnings("serial")
public class ResultData implements Serializable {
	private boolean success = true;
	private String errorMsg;
	private Object Data;

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public Object getData() {
		return Data;
	}

	public void setData(Object data) {
		Data = data;
	}

	public static ResultData success (){
		return new ResultData();
	}

	public static ResultData success (Object obj){
		ResultData res = success();
		res.setData(obj);
		return res;
	}

	public static ResultData fail (){
		ResultData res = new ResultData();
		res.setSuccess(false);
		return res;
	}
	public static ResultData fail (String errorMsg){
		ResultData fail = fail();
		fail.setErrorMsg(errorMsg);
		return fail;
	}
}
